package com.qingxin.cms.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * QxNotices entity. 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "qx_notices")
public class QxNotices extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = -2715930789676665158L;
	// Fields

	private String noticeid;
	private String title;
	private String contents;
	private Integer noticeType;
	private String companyid;
	private String parkid;
	private String pubUser;
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private Date pubDate;
	private String createBy;
	private Date createTime;
	private String updateBy;
	private Date updateTime;
	private Set<QxNoticesAttachments> qxNoticesAttachmentses = new HashSet<>(0);

	// Constructors

	/** default constructor */
	public QxNotices() {
	}

	
	public QxNotices(String noticeid, String title, Integer noticeType,
			String pubUser, Date pubDate, Date createTime) {
		this.noticeid = noticeid;
		this.title = title;
		this.noticeType = noticeType;
		this.pubUser = pubUser;
		this.pubDate = pubDate;
		this.createTime = createTime;
	}


	/** full constructor */
	public QxNotices(String title, String contents, Integer noticeType,
			String companyid, String parkid, String createBy,
			Date createTime,
			Set<QxNoticesAttachments> qxNoticesAttachmentses) {
		this.title = title;
		this.contents = contents;
		this.noticeType = noticeType;
		this.companyid = companyid;
		this.parkid = parkid;
		this.createBy = createBy;
		this.createTime = createTime;
		this.qxNoticesAttachmentses = qxNoticesAttachmentses;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "noticeid", unique = true, nullable = false, length = 32)
	public String getNoticeid() {
		return this.noticeid;
	}

	public void setNoticeid(String noticeid) {
		this.noticeid = noticeid;
	}

	@Column(name = "title", length = 300)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "contents")
	public String getContents() {
		return this.contents;
	}

	public void setContents(String contents) {
		this.contents = contents;
	}

	@Column(name = "notice_type")
	public Integer getNoticeType() {
		return this.noticeType;
	}

	public void setNoticeType(Integer noticeType) {
		this.noticeType = noticeType;
	}

	@Column(name = "companyid", length = 32)
	public String getCompanyid() {
		return this.companyid;
	}

	public void setCompanyid(String companyid) {
		this.companyid = companyid;
	}

	@Column(name = "parkid", length = 32)
	public String getParkid() {
		return this.parkid;
	}

	public void setParkid(String parkid) {
		this.parkid = parkid;
	}

	@Column(name = "pub_user", length = 100)
	public String getPubUser() {
		return pubUser;
	}


	public void setPubUser(String pubUser) {
		this.pubUser = pubUser;
	}

	@Column(name = "pub_date", length = 23)
	public Date getPubDate() {
		return pubDate;
	}


	public void setPubDate(Date pubDate) {
		this.pubDate = pubDate;
	}


	@Column(name = "create_by", length = 50)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@Column(name = "update_by", length = 32)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_time", length = 23)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "qxNotices")
	@JsonIgnore
	public Set<QxNoticesAttachments> getQxNoticesAttachmentses() {
		return this.qxNoticesAttachmentses;
	}

	public void setQxNoticesAttachmentses(
			Set<QxNoticesAttachments> qxNoticesAttachmentses) {
		this.qxNoticesAttachmentses = qxNoticesAttachmentses;
	}

}